package solution;

import org.junit.jupiter.api.Test;

public class DirectedCycleTest {
    @Test
    public void test(){
        // 0:[5]
        // 1:[]
        // 2:[]
        // 3:[5]
        // 4:[3]
        // 5:[4]
        Graph<Integer> digraph = new AdjacencyListDigraph<>();
        digraph.addEdge(0, 5);
        digraph.addEdge(3, 5);
        digraph.addEdge(4, 3);
        digraph.addEdge(5, 4);


        DirectedCycle<Integer> cycle = new DirectedCycle<>(digraph);
        System.out.println(cycle.hasCycle());
        System.out.println(cycle.cycle());
    }
}
